// common.js
const express = require("express");
const router = express.Router();
const multer = require("multer");//即文件上传的中间件
const storage = require("../storage");//Multer将使用此配置来决定如何存储上传的文件

// 创建 multer 中间件
const upload = multer({
  storage: storage,
});

const Common = require("../api/common");

router.post("/upload", upload.single("file"), Common.upload);

module.exports = router;
